package org.cloudnote.controller;

import org.cloudnote.service.NoteService;
import org.cloudnote.util.NoteResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/note")
public class AddNoteController {

    @Autowired
    private NoteService noteService;

    @ResponseBody
    @RequestMapping("/add.do")
    public NoteResult execute(String bookId,String userId,String noteTitle){
      //测试异常：  System.out.println(bookId.length());
        NoteResult result = noteService.addNote(bookId, userId, noteTitle);
        return result;
    }

}
